/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.ylystudio.pms.ejb.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Kenny Lin
 */
@Embeddable
public class ErrorMiddlePK implements Serializable {
    @Basic(optional = false)
    @Column(name = "grade_id")
    private int gradeId;
    @Basic(optional = false)
    @Column(name = "error_id")
    private int errorId;

    public ErrorMiddlePK() {
    }

    public ErrorMiddlePK(int gradeId, int errorId) {
        this.gradeId = gradeId;
        this.errorId = errorId;
    }

    public int getGradeId() {
        return gradeId;
    }

    public void setGradeId(int gradeId) {
        this.gradeId = gradeId;
    }

    public int getErrorId() {
        return errorId;
    }

    public void setErrorId(int errorId) {
        this.errorId = errorId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) gradeId;
        hash += (int) errorId;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ErrorMiddlePK)) {
            return false;
        }
        ErrorMiddlePK other = (ErrorMiddlePK) object;
        if (this.gradeId != other.gradeId) {
            return false;
        }
        if (this.errorId != other.errorId) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.ylystudio.pms.ejb.entity.ErrorMiddlePK[gradeId=" + gradeId + ", errorId=" + errorId + "]";
    }

}
